
#pragma once

#include <osgViewer/Viewer>
#include <osgGA/GUIEventHandler>
#include <osgGA/GUIEventAdapter>

#include <Interactiv/Command>
#include <Interactiv/Interactiv>

#include <Interactiv/Command>
#include <osg/MatrixTransform>
#include <osg/Projection>

#include <selectTool/Export>

#include <Interactiv_BIM/Interactiv_BIM>

namespace SelectTool_ {

class  SelectTool_EXPORT PointSelectCommand : public Command
{
public:
	PointSelectCommand(Interactiv_Base* bim_Interactiv, int type);
	~PointSelectCommand();

public:
	virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);

	void CommandBegin(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
	void CommandEnd(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)  ;
	void CommandExe(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)  ;

	osg::Vec3d WindowToWorldPoint(const osgGA::GUIEventAdapter& event, float p);

private:
	osg::ref_ptr<osg::Geode> geode_             ;
	osg::ref_ptr<osg::Geometry> geometry_       ;
	osg::ref_ptr<osg::Projection> projection_   ;

	InteractivBIM* bim_Interactiv_            ;
	osg::ref_ptr<osg::MatrixTransform> modeview_;
};

}

using namespace SelectTool_;
